
#pragma once
#include <ras.h>
#include <RasError.h>
#include <Wininet.h>
#pragma comment(lib, "Rasapi32.lib")
#pragma comment(lib,"wininet.lib")

#define MAX_ENTRY_LEN 20

/*
Modify By www.cctry.com
*/

class CAdslMgr
{
public:
	CAdslMgr();
	~CAdslMgr();

public:
	CString CheckNet();
	BOOL RAS_Connect(CString strUser = _T(""), CString strPass = _T(""), CString *pOutIpAddr = NULL);
	void RAS_Close(BOOL bCloseAll = FALSE);
	BOOL IsConnected();
	BOOL CreatePPPoE(CString strEntryName, CString strUser = _T(""), CString strPass = _T(""));
	BOOL OnEnum(CString strPPPoEName);

	CString m_strPPPoEName;

	BOOL ChangeIpAddr(CString strPPPoEName, CString strUser, CString strPass);
	
private:
	BOOL GetIpAddrByRemote(CString& strIp);
	CMap <CString,LPCTSTR,CString,LPCTSTR> m_IpMap;
};

